home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / smtetris < prev    next >
Text File  |  1995-03-31  |  7KB  |  297 lines

  1. Article 4925 of comp.sys.handhelds:
  2. Path: en.ecn.purdue.edu!noose.ecn.purdue.edu!samsung!zaphod.mps.ohio-state.edu!sdd.hp.com!hp-pcd!hpcvra.cv.hp.com!rnews!hpcvbbs!akcs.falco
  3. From: akcs.falco@hpcvbbs.UUCP (Andrey Dolgachev)
  4. Newsgroups: comp.sys.handhelds
  5. Subject: SmTetris for the HP48SX
  6. Keywords: tetris, small
  7. Message-ID: <27da7ab6:2372comp.sys.handhelds@hpcvbbs.UUCP>
  8. Date: 10 Mar 91 18:40:10 GMT
  9. Lines: 283
  10.  
  11. O.K., In addition to the cooler version of Tetris with everything,
  12. including the kitchen sink, I also decided to post a severely cut-down
  13. version which takes up far less memory.  Tetris2 is the large version
  14. that I posted last night, which takes up 6500 bytes.  SmTetris is
  15. essentially the original version of Tetris with ML, but with all the bug
  16. fixes, better key-input and the pause of the new one.  Since there is no
  17. online help, here we go.
  18.   The controls are: 8 to rotate, 0 to drop, 4 to move left, 6 to move
  19. right, O to turn the calculator off (game resumes when you turn it on),
  20. and P to pause the game (returns you to teh stack, allowing you to use
  21. the calculator normally).
  22.   In the VAR menu, press START to start (what a thought), and RESU to
  23. resume a game that was paused.  The paused game stays in stasis until you
  24. start a new game of Tetris with the same copy of Tetris.  When you
  25. download Tetris from this message, there is a program called SETUP. 
  26. Simply press this and it does everything to make Tetris a working copy. 
  27. Be sure to put ASC-> in the same level or a higher level thatn the level
  28. of Tetris.  After SETUP, Tetris takes up only 3300 bytes, which is
  29. significatly smaller than the its big brother.  SmTetris doesn't have the
  30. high socres, next key, background, help, or oth neat features of Tetris2,
  31. so if you have the extra mem, Tetris2 is cooler.  O.K>, I think that's
  32. it, everything should work, cut the following.
  33. ---------------------cut here----------------------
  34. %%HP: T(3)A(D)F(.);
  35. DIR
  36.   SETUP
  37.     \<<
  38.       IF XFIG ASC\->
  39. DEPTH 2 ==
  40.       THEN
  41. "PLEASE PUT ASC\-> IN
  42. OR ABOVE THIS DIR."
  43. 1 DISP 0 WAIT DROP  DROP2
  44.       ELSE TLIST 1
  45. 1 TLIST SIZE
  46.         START GETI
  47. DUP RCL STRIP SWAP
  48. STO
  49.         NEXT DROP2
  50. 'XFIG' STO TFIG
  51. ASC\-> 'TFIG' STO
  52. { TLIST STRIP
  53. SETUP } PURGE
  54.       END
  55.     \>>
  56.   STRIP
  57.     \<< # 21679d
  58. SYSEVAL # 15950d
  59. SYSEVAL # 397211d
  60. SYSEVAL # 21573d
  61. SYSEVAL # 397211d
  62. SYSEVAL
  63.     \>>
  64.   TLIST { start
  65. RESU TETRIS delay
  66. ADDL ADDP FULL
  67. MKSCR MSIDE RK2 P2
  68. PACK ROTF TLIN }
  69.   start
  70.     \<<  RCLF
  71. DEPTH 'L' STO
  72. IFERR TETRIS THEN
  73.     END 
  74. DEPTH L - DROPN STOF ""
  75. 'SAV' STO
  76.   \>>
  77. RESU
  78.   \<< IFERR SAV LIST\->
  79. DROP PICT SWAP {
  80. # 0d # 0d } SWAP
  81. REPL { # 0d # 0d }
  82. PVIEW CONT THEN
  83. "Game is not paused.
  84. Press START to start
  85. a new game."
  86. 3 DISP DROP 0 WAIT DROP
  87.   END
  88. \>>
  89.               XFIG
  90. "CCD204410034E7507137143818F8E1358BE60691117E818F328FB97601CE1B56
  91. 507146134152739E1B20F880029916912014313234E4A201428A2606EB016915
  92. 271011741431321428A63E16915271001741431321428A68C1691567AFAAF122
  93. A95118C9AF5BF522A8520A8181D22A82C1201B56507146818F29818F29C91341
  94. 19BF2BF2241542BF616F16F1610D880BEBF4BF4BF4AF68AA60688F208F2D7601
  95. 42164808CE7C9"
  96.               TFIG
  97. "CCD20E310013606DD061B97507142137135818F098BA606FF014713481AF0914
  98. 234E4A208A26060E01691527100E717414381AF2914581AF291321428A26060B
  99. 01691567AFAAF1D122A95118C9D5F522A8520A81819F122A82C1201B56507146
  100. 818F29818F29C9136AF2156090A90B456E002F308200E49BF4BF4BF4AF68AE09
  101. AF0AF2AC48108087340E68084396840E614313216915472007DD071361421648
  102. 08C3CA6"
  103.               L 2
  104.               SAV
  105. ""
  106.               TETRIS
  107. \<< STD 64 STWS .404
  108. 'a' STO 1 CF
  109. 12 CF 7 CF MKSCR
  110. 0 'PNTS'
  111. STO 0 'LINS' STO 0
  112. ADDL 0 ADDP
  113.   DO delay FLST
  114. RAND 7 * IP 1 +
  115. DUP
  116. 'OB1' STO GET 1 DUP
  117. 'OB2' STO GET # 11d
  118. 1 CF
  119.     DO
  120.       IF 1 FC?
  121.       THEN RK2 RK2
  122. RK2 RK2 a WAIT
  123.       END
  124.       IF 3 FC?
  125.       THEN DUP2
  126. # 0d XFIG # 256d +
  127. DUP2 # 0d + TFIG
  128.         IF # 0d ==
  129.         THEN DUP2
  130. # 63903d XFIG
  131.         ELSE # 256d
  132. - # 63903d XFIG
  133. # 0d
  134.         END
  135.       END
  136.     UNTIL DUP # 0d
  137. == 
  138.     END
  139.     20 ADDP
  140. DROP PACK MEM DROP
  141.     UNTIL FULL  END FIN
  142. \>>
  143.               delay
  144. \<< a .004 - DUP
  145.   IF 0 \<=
  146.   THEN .004 'a' STO
  147. DROP
  148.   ELSE 'a' STO
  149.   END
  150. \>>
  151.               a
  152. .404
  153.               LINS
  154. 0
  155.               ADDL
  156. \<< 'LINS' STO+ PICT {
  157. # 100d # 8d } LINS
  158. 1 \->GROB REPL \>>
  159.               ADDP
  160. \<< 'PNTS' STO+ PICT {
  161. # 5d # 8d } PNTS 1
  162. \->GROB REPL \>>
  163.               FLST
  164. { {
  165. # 17802707620356d
  166. # 279242096899d
  167. # 35399189680388d
  168. # 279242096901d } {
  169. # 279242096645d
  170. # 17802707620357d
  171. # 279242097155d
  172. # 17806986854917d }
  173. { # 206226604548d
  174. # 17944425808389d
  175. # 279242097157d
  176. # 17802707620355d }
  177. { # 279241044483d
  178. # 17802708664837d }
  179. { # 210504794628d
  180. # 35399188627717d }
  181. { # 52926935483141d
  182. # 279242097412d } {
  183. # 206226600196d } }
  184.               FULL
  185. \<<
  186. # 72356802986000645d
  187. # 778d DUP2 # 0d +
  188. TFIG ROT ROT # 5d +
  189. TFIG + # 0d >
  190. \>>
  191.               MKSCR
  192. \<< ERASE (-2.2,3.2)
  193. (1.9,-2.8) BOX PICT 
  194. { # 44d # 0d }
  195. # 40d # 60d BLANK
  196. REPL PICT { # 95d
  197. # 2d } "LINES :" 1
  198. \->GROB REPL PICT {
  199. # 2d # 2d }
  200. "SCORE :" 1 \->GROB
  201. REPL { # 0d # 0d }
  202. PVIEW \>>
  203.               MSIDE
  204. \<< \-> CD
  205.   \<< DUP2 # 0d XFIG
  206. CD + DUP2 # 0d +
  207. TFIG
  208.     IF # 0d \=/
  209.     THEN CD -
  210.     END DUP2
  211. # 63903d XFIG
  212.   \>>
  213. \>>
  214.               RK2
  215. \<<
  216.   IF KEY
  217.   THEN
  218.     IF { 72 74 92
  219. 63 34 33 }
  220. SWAP POS DUP
  221.     THEN {
  222.       \<< # 1d NEG
  223. MSIDE
  224.       \>>
  225.       \<< # 1d MSIDE
  226.       \>>
  227.       \<< 1 SF
  228.       \>> ROTF
  229.       \<< PICT RCL
  230. DEPTH L - 1 + \->LIST
  231. 'SAV' STO HALT
  232.       \>> OFF } SWAP GET
  233. EVAL
  234.     ELSE DROP
  235.     END
  236.   END
  237. \>>
  238.               OB1 3
  239.               OB2 1
  240.               P2
  241. \<< 100 ADDP 1 ADDL
  242. DUP # 3840d AND SRB
  243. 4 * 3 + # 43d SWAP
  244. 2 \->LIST PICT SWAP {
  245. # 83d # 8d } SUB
  246. PICT { # 43d # 12d
  247. } ROT REPL
  248. \>>
  249.               PACK
  250. \<< # 3338d
  251.   DO TLIN
  252.     IF # 4d ==
  253.     THEN P2
  254.     ELSE # 256d -
  255.     END
  256.   UNTIL DUP # 512d
  257. <
  258.   END DROP
  259. \>>
  260.               ROTF
  261. \<< DUP2 # 0d XFIG
  262. FLST OB1 GET OB2 1
  263. -
  264.   IF DUP 0 \<=
  265.   THEN DROP DUP
  266. SIZE
  267.   END DUP \-> OS2
  268.   \<< GET SWAP DUP2
  269. # 0d + TFIG
  270.     IF # 0d ==
  271.     THEN ROT DROP
  272. OS2 'OB2' STO
  273.     ELSE SWAP DROP
  274.     END DUP2
  275. # 63903d XFIG
  276.   \>>
  277. \>>
  278.               TLIN
  279. \<< DUP
  280. # 72356802986000645d
  281. SWAP DUP2 # 0d +
  282. TFIG ROT ROT # 5d +
  283. TFIG +
  284. \>>
  285.               PNTS
  286. 0
  287.               PPAR
  288. { (-6.5,-3.1)
  289. (6.5,3.2) X 0 (0,0)
  290. FUNCTION Y }
  291.        END
  292.  
  293. ------------------that's all------------------
  294.     --Falco
  295.  
  296.  
  297.